import deliveryExpressApi from "@/api/declaration/mall/deliveryExpressApi"
import httpRequest from "@/config/axios/httpRequest"
import { DeliveryExpressTemplateModel } from "@/models/mall/DeliveryExpressTemplateModel"


// 查询快递运费模板列表
export const getDeliveryExpressTemplatePage = async (params: PageParam) => {
  return await httpRequest.get(deliveryExpressApi.GetDeliveryExpressTemplatePage, {params})
}

// 查询快递运费模板详情
export const getDeliveryExpressTemplate = async (id: number) => {
  return await httpRequest.get(deliveryExpressApi.GetDeliveryExpressTemplate, {params: {id}})
}

// 查询快递运费模板详情
export const getSimpleTemplateList = async () => {
  return await httpRequest.get(deliveryExpressApi.GetSimpleTemplateList)
}

// 新增快递运费模板
export const createDeliveryExpressTemplate = async (data: DeliveryExpressTemplateModel) => {
  return await httpRequest.post(deliveryExpressApi.CreateDeliveryExpressTemplate, data)
}

// 修改快递运费模板
export const updateDeliveryExpressTemplate = async (data: DeliveryExpressTemplateModel) => {
  return await httpRequest.put(deliveryExpressApi.UpdateDeliveryExpressTemplate, data)
}

// 删除快递运费模板
export const deleteDeliveryExpressTemplate = async (id: number) => {
  return await httpRequest.delete(deliveryExpressApi.DeleteDeliveryExpressTemplate, {params: {id}})
}
